﻿using Exceptionless;
using Exceptionless.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ongoal.Quotation.Log
{
    /// <summary>
    /// 日志接口类
    /// </summary>
    public interface IDistributedLog
    {
        /// <summary>
        /// 追溯日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Trace(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 调试日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Debug(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 信息日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Info(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 警告日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Warn(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 错误日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Error(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 致命错误日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Fatal(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 其他日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Other(string source, string message, object? data, params string[] tags);

        /// <summary>
        /// 异常日志
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">日志内容</param>
        /// <param name="data">日志数据</param>
        /// <param name="tags">标签</param>
        void Exception(string source, Exception exception, object? data, params string[] tags);

        /// <summary>
        /// 创建日志事件处理类（需要手动调用Submit提交日志）
        /// </summary>
        /// <param name="source">模块</param>
        /// <param name="message">消息</param>
        /// <param name="logLevel">日志等级</param>
        /// <returns></returns>
        EventBuilder CreateLog(string source, string message, LogLevel logLevel);
    }
}
